{template "header.html"}

<div class="note note-danger">
    <p>将模块内容字段已经创建好的【附表】和【主表】字段进行相互转移</p>
    <p>官方设计主表和附表的初衷是：主表存储用于搜索和列表显示的字段、附表存储只能在内容详情页显示的字段；开发者需要合理创建字段的类型，不要给主表增加负担。</p>
</div>
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    <div class="table-scrollable">
        <table class="table table-striped table-bordered table-hover table-checkable dataTable">
            <thead>
            <tr class="heading">
                <th width="100"> 目录 </th>
                <th width="300"> 名称</th>
                <th width="100"> 主表</th>
                <th> </th>
            </tr>
            </thead>
            <tbody>
            {loop $module $dir $t}
            <tr class="odd gradeX">
                <td>{$dir}</td>
                <td>
                    <b><i class="{dr_icon($t.icon)}"></i> {$t.name}</b>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            {loop $t.field $f}
            <tr class="odd gradeX">
                <td> └ </td>
                <td>
                    └ {$f.name} / {$f.fieldname}
                </td>
                <td>
                    {if $f.ismain}<font color="green">主表</font>{else}<font color="red">附表</font>{/if}
                </td>
                <td>
                    {if $f.ismain}
                    <label><a href="javascript:dr_iframe_show('code', '{dr_url(APP_DIR.'/home/f_index', ['dir'=>$t.dirname, 'fid' => $f.id, 'fname' => $f.fieldname])}');" class="btn btn-xs green">{dr_lang('转换为附表字段')}</a></label>
                    {else}
                    <label><a href="javascript:dr_iframe_show('code', '{dr_url(APP_DIR.'/home/z_index', ['dir'=>$t.dirname, 'fid' => $f.id, 'fname' => $f.fieldname])}');" class="btn btn-xs red">{dr_lang('转换为主表字段')}</a></label>
                    {/if}
                </td>
            </tr>
            {/loop}
            {/loop}
            </tbody>
        </table>
    </div>
</form>

{template "footer.html"}